#include "reg51.h"

#define ADDR0 P1_0
#define ADDR1 P1_1
#define ADDR2 P1_2
#define ADDR3 P1_3
#define ENLED P1_4

#define LED0 P0_0
#define LED1 P0_1
#define LED2 P0_2
#define LED3 P0_3

#define KeyIn1 P2_4
#define KeyIn2 P2_5
#define KeyIn3 P2_6
#define KeyIn4 P2_7

int main() {
    ENLED = 0;
    ADDR3 = 1;
    ADDR2 = 1;
    ADDR1 = 1;
    ADDR0 = 0;

    P2 = 0xFE;


    while (1) {
        LED0 = KeyIn1;
        LED1 = KeyIn2;
        LED2 = KeyIn3;
        LED3 = KeyIn4;
    }
}
